package com.ksd.system.service.impl;

import java.util.List;

import com.ksd.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ksd.system.mapper.SysNetworkMapper;
import com.ksd.system.domain.SysNetwork;
import com.ksd.system.service.ISysNetworkService;

/**
 * 网络配置Service业务层处理
 * 
 * @author y.wu
 * @date 2025-01-08
 */
@Service
public class SysNetworkServiceImpl implements ISysNetworkService 
{
    @Autowired
    private SysNetworkMapper sysNetworkMapper;

    /**
     * 查询网络配置
     * 
     * @param id 网络配置主键
     * @return 网络配置
     */
    @Override
    public SysNetwork selectSysNetworkById(Long id)
    {
        return sysNetworkMapper.selectSysNetworkById(id);
    }

    /**
     * 查询网络配置列表
     * 
     * @param sysNetwork 网络配置
     * @return 网络配置
     */
    @Override
    public List<SysNetwork> selectSysNetworkList(SysNetwork sysNetwork)
    {
        return sysNetworkMapper.selectSysNetworkList(sysNetwork);
    }

    /**
     * 新增网络配置
     * 
     * @param sysNetwork 网络配置
     * @return 结果
     */
    @Override
    public int insertSysNetwork(SysNetwork sysNetwork)
    {
        sysNetwork.setCreateTime(DateUtils.getNowDate());
        return sysNetworkMapper.insertSysNetwork(sysNetwork);
    }

    /**
     * 修改网络配置
     * 
     * @param sysNetwork 网络配置
     * @return 结果
     */
    @Override
    public int updateSysNetwork(SysNetwork sysNetwork)
    {
        sysNetwork.setUpdateTime(DateUtils.getNowDate());
        return sysNetworkMapper.updateSysNetwork(sysNetwork);
    }

    /**
     * 批量删除网络配置
     * 
     * @param ids 需要删除的网络配置主键
     * @return 结果
     */
    @Override
    public int deleteSysNetworkByIds(Long[] ids)
    {
        return sysNetworkMapper.deleteSysNetworkByIds(ids);
    }

    /**
     * 删除网络配置信息
     * 
     * @param id 网络配置主键
     * @return 结果
     */
    @Override
    public int deleteSysNetworkById(Long id)
    {
        return sysNetworkMapper.deleteSysNetworkById(id);
    }
}
